#include <MainMenu.h>
#include <World.h>

#include <LoadArea.h>
#include <Area_Alpha.h>
#include <Area_Beta.h>
#include <DoNothing.h>

#include <Area_Planet_A.h>

MainMenu::MainMenu(World& gameworld)
:world(gameworld)
,activeScreen(0)
{
}

MainMenu::~MainMenu()
{
}

void MainMenu::Load()
{
	std::list<MenuButton> main;
	
	main.push_back( MenuButton("Start Game", world, 
		//new DoNothing() ,
		new LoadArea<AreaPlanetA>( &world ) , 
		vec2(300,250),150,40) );

	main.push_back( MenuButton("Test Area 1", world, 
		//new DoNothing() ,
		new LoadArea<Alpha>( &world ) , 
		vec2(300,300),150,40) );
	
	main.push_back( MenuButton("Test Area 2", world, 
		new LoadArea<Beta>( &world ) ,
		vec2(300,350),150,40) );
	screens.push_back( main );
}

void MainMenu::Update()
{
	std::list<MenuButton>::iterator iter = screens[activeScreen].begin();
	for( ; iter != screens[activeScreen].end(); ++iter )
	{
		iter->Update();
	}
}

void MainMenu::Draw()
{
	std::list<MenuButton>::iterator iter = screens[activeScreen].begin();
	for( ; iter != screens[activeScreen].end(); ++iter )
	{
		iter->Draw();
	}
}

//	std::list<MenuButton> buttons;